Allow command line arguments to xcsv-derived files.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 10 Apr 2003 03:17:13 +0000 (03:17 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 10 Apr 2003 03:17:13 +0000 (03:17 +0000)
gpsbabel/vecs.c

index c67cff2c9352108a3f17ab1c2bcfb54053c24bf1..fb7c61c51f7c6eca677d8b6753f38400d3a0c799 100644 (file)
@@ -215,10 +215,25 @@ find_vec(char *const vecname, char **opts)
         * is to search the list of xcsv styles.
         */
        while (svec->name) {
+               arglist_t *ap;
+               char *res;
+
                if (strcmp(svecname, svec->name)) {
                        svec++;
                        continue;
                }
+
+               res = strchr(vecname, ',');
+               if (res) {
+                       *opts = strchr(vecname, ',') + 1;
+                       if (vec_list[0].vec->args) {
+                               for (ap = vec_list[0].vec->args; ap->argstring; ap++) {
+                                       *ap->argval = get_option(*opts, ap->argstring);
+                               }
+                       }
+               } else {
+                       *opts = NULL;
+               }
                xcsv_read_internal_style(svec->style_buf);
 
                xfree(v);